package cn.seaboot.admin.activemq.web;

import cn.seaboot.admin.activemq.MqttGateway;
import cn.seaboot.admin.mvc.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;


/**
 * @author ChenSS on 2018/6/19.
 */
@Controller
@RequestMapping("debug")
public class MQCtrl {

    @Resource
    private MqttGateway mqttGateway;

    @ResponseBody
    @RequestMapping("mqtt")
    public Result valid() {
        mqttGateway.send("mqtt", "demo");
        return Result.SUCCEED;
    }
}
